Skip to main content

Simulate Static Deposit (Sandbox)

In sandbox, a deposit to one of the account's static deposit details is simulated with one API call: you say which detail received money, how much and, optionally, who sent it. The deposit then goes through the same processing as in production. Avenia creates the ticket, converts the amount to USDC, credits the INTERNAL balance and sends the ticket webhooks, exactly as it would for a real transfer.

It works for every static deposit detail:

currencypaymentMethodDetail in Account InfoWhat it simulates
MXNCLABEclabeA Mexican bank transfer to the account's CLABE
ARSCVUcvuAn Argentine transfer to the account's CVU
COPBRE-Bbre-bA Bre-B payment to the account's key
USDSWIFTswiftReceivingAccountA SWIFT transfer to the account's receiving account
info

This endpoint exists only in sandbox. In production the deposit comes from a real transfer to the same detail, and the same ticket, webhooks and credit follow.

Before you start​

The account needs the detail you want to simulate. GET /v2/account/account-info shows it:

  • clabe, cvu and bre-b show up once the account's KYC or KYB for that currency is approved.
  • swiftReceivingAccount shows up once Avenia enables SWIFT deposits for the account. Ask your account manager to enable them for your sandbox account.

See Get the Static Deposit Details.

1. Read the details​

cURL
curl -X GET "https://api.sandbox.avenia.io:10952/v2/account/account-info" \
-H "Authorization: Bearer eyJhdXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
JSON
{
"clabe": "999999000012345678",
"cvu": "0009999000001234567890",
"bre-b": "@SBX000000001234",
"swiftReceivingAccount": {
"beneficiaryName": "Jane Doe",
"bankName": "Sandbox Bank",
"bic": "SBXXUS33XXX",
"accountNumber": "9999000123456789",
"routingNumber": "999999999",
"bankAddress": {
"street1": "1 Sandbox Plaza",
"street2": "",
"city": "New York",
"region": "NY",
"postalCode": "10001",
"country": "US"
}
}
}

In sandbox these are test details no real bank can pay. Show them the way you will show the real ones in production.

2. Simulate the deposit​

POSThttps://api.sandbox.avenia.io:10952/v2/account/sandbox/static-deposits

The deposit always lands on the account's own detail for that currency: you don't send the detail itself.

Parameters​

FieldInTypeDescription
subAccountIdquerystringOptional. The sub-account that receives the deposit. Omit it for the main account.

Body​

FieldTypeRequiredApplies toDescription
currencystringYesAllMXN, ARS, COP or USD.
paymentMethodstringNoAllCLABE, CVU, BRE-B or SWIFT. Defaults to the currency's method in the table above.
amountstringYesAllThe amount that arrives, in currency, as a decimal string with at most two decimals, such as "150.00".
senderNamestringNoAllThe sender's name. For USD, omit it for a transfer from the account holder.
senderTaxIdstringNoMXN, ARS, COPThe sender's tax ID, such as a CUIT for ARS.
senderAccountNumberstringNoAllThe account the money came from: a CBU or CVU for ARS, an account number or IBAN for USD. An ARS deposit that is not credited is sent back to it, as in production.
senderTypestringNoUSDindividual or business. Defaults to individual.
senderBankNamestringNoUSDThe sender's bank.
senderBicstringNoUSDThe sender's bank BIC.
paymentReferencestringNoUSDThe reference the sender wrote on the transfer.

Fields that don't apply to the currency are ignored.

Request examples​

MXN to the CLABE:

cURL
curl -X POST "https://api.sandbox.avenia.io:10952/v2/account/sandbox/static-deposits" \
-H "Authorization: Bearer eyJhdXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"currency": "MXN",
"amount": "1000.00"
}'

USD by SWIFT:

cURL
curl -X POST "https://api.sandbox.avenia.io:10952/v2/account/sandbox/static-deposits" \
-H "Authorization: Bearer eyJhdXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"amount": "150.00",
"senderBankName": "Example Bank",
"paymentReference": "INVOICE-1042"
}'

Response​

202 Accepted. The deposit is processed in the background.

JSON
{
"id": "sbx-3f1c2a7e-5b8d-4e6f-9a0b-1c2d3e4f5a6b",
"externalId": "mxn-deposit-sbx-3f1c2a7e-5b8d-4e6f-9a0b-1c2d3e4f5a6b"
}
  • id is the simulated deposit. Every call is a new deposit: calling twice simulates two deposits.
  • externalId is the externalId of the ticket Avenia creates for it.

3. Follow the ticket​

Avenia creates the deposit's ticket by itself within seconds of the call, and you receive its webhooks as for a real deposit. See Webhook Events and When Avenia asks for the code afterwards.

For every currency these are DEPOSIT-PROCESSING, DEPOSIT-SUCCESS, DELIVERY-PROCESSING, DELIVERY-SUCCESS, TICKET-PURPOSE-CODE-REQUIRED and TICKET-COMPLETE. They can arrive in a different order.

To find the ticket without a webhook, list the tickets by the externalId the call returned:

cURL
curl -X GET "https://api.sandbox.avenia.io:10952/v2/account/tickets/?externalId=mxn-deposit-sbx-3f1c2a7e-5b8d-4e6f-9a0b-1c2d3e4f5a6b" \
-H "Authorization: Bearer eyJhdXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

The ticket has the deposit's currency and payment method as input, outputCurrency USDC and outputPaymentMethod INTERNAL, and ends PAID with the USDC credited to the account's INTERNAL balance.

Simulating a third-party SWIFT sender​

For USD, send a senderName that is not the account holder's name to simulate a transfer from someone else:

cURL
curl -X POST "https://api.sandbox.avenia.io:10952/v2/account/sandbox/static-deposits" \
-H "Authorization: Bearer eyJhdXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"amount": "80.00",
"senderName": "Example Trading Inc",
"senderType": "business",
"senderBic": "EXAMPLEXXXX"
}'

It is a third-party deposit and is priced as one. When the account doesn't accept third-party deposits, it is held for compliance review instead of being credited, as in production. See USD by SWIFT.

Errors​

The call is checked before anything is processed:

StatusMessageMeaning
400CLABE deposits are not enabled for this accountThe account has no clabe yet. The same message names CVU, BRE-B or SWIFT for the other details. See Before you start.
400InvalidFieldError: currency is invalidcurrency is missing or is not MXN, ARS, COP or USD.
400InvalidFieldError: paymentMethod is invalidpaymentMethod is not the currency's method, for example CVU with MXN.
400InvalidFieldError: amount is invalidThe amount is missing, not a number, not positive, or has more than two decimals.
400InvalidFieldError: senderType is invalidFor USD, senderType is neither individual nor business.
404NotFoundError: subAccountId not foundsubAccountId is not a sub-account of yours.

What is not simulated​

These behave exactly as in production:

  • The account's limits: a deposit over the monthly fiat-in limit for its currency is not credited. See Limits.
  • The fees and the quote of the conversion to USDC. A deposit that doesn't cover the fees of its currency and method, such as a SWIFT deposit smaller than the SWIFT fee, is not credited and gets no ticket.
  • For USD, the comparison of the sender with the account holder.

If any of these return an unexpected result in sandbox, it reflects a real behavior, not the simulation.